package service;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import user.com.User;

import java.util.Map;

/**
 * @ClassName : Long
 * @Author : MagicJava
 * @Date: 2020-12-04 10:54
 * @Description : 登陆类
 */
public class Logn extends ActionSupport {
    private User user;

    private String id;
    private static Map request;
    private Map session;
    private Map application;

    public Logn() {

        request = (Map) ActionContext.getContext().get("request");
        session = ActionContext.getContext().getSession();
        application = ActionContext.getContext().getApplication();
        System.out.println(ActionContext.getContext().get("request") == null);
        System.out.println(id);
    }

    public void logns() {

        request = (Map) ActionContext.getContext().get("request");
        session = ActionContext.getContext().getSession();
        application = ActionContext.getContext().getApplication();
        System.out.println(ActionContext.getContext().get("request") == null);
        System.out.println(request == null);
    }


    public String ja() throws Exception {
        //logns();
        request.put("rq_key", "rq");
        session.put("sess_key", "sess");
        application.put("app_key", "app");
        return "qj";
    }

    // private HibernateUtil hu = new HibernateUtil();
    //Session session;

}
